package com.cloudlead.forwardAction.action;

import com.cloudlead.common.lang.BusinessModule;
import com.cloudlead.common.lang.annotation.Label;
import com.cloudlead.common.worker.action.impl.AbstractActionFactory;
import com.cloudlead.common.worker.annotation.Action;
import com.cloudlead.common.worker.annotation.Order;
import com.cloudlead.forwardAction.BusinessModules;
import com.cloudlead.forwardAction.service.OrderInformationSaveSer;
import com.cloudlead.forwardService.OrderInformationSaveService;
import com.cloudlead.forwardService.vo.OrderInformationVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;

import javax.validation.constraints.NotNull;

/**
 * Created by wyj on 2015/8/22.
 */
@Controller
public class OrderInformationSaveActionFactory extends AbstractActionFactory implements OrderInformationSaveService{
    @Autowired
    OrderInformationSaveSer orderInformationSaveSer;


    public OrderInformationSaveActionFactory() {
        super(BusinessModules.OrderInformationSave);
    }

    @Override
    @Action
    @Order(1)
    @Label("订单信息保存")
    public String orderInformationSave(@NotNull @Label("基本信息")OrderInformationVo orderInformationVo) {
        return orderInformationSaveSer.orderInformationSave(orderInformationVo);
    }


    @Override
    @Action
    @Order(2)
    @Label("车队订单操作")
    public String fleetOrderOperate(@NotNull @Label("订单状态[0/1(接受/拒绝)]")String orderStatus, @NotNull @Label("车队订单ID")String id) {
        return orderInformationSaveSer.fleetOrderOperate(orderStatus,id);
    }

    @Override
    @Action
    @Order(3)
    @Label("货代订单操作")
    public String forwardOrderOperate(@NotNull @Label("订单状态[0/1(接受/拒绝)]")String orderStatus, @NotNull @Label("订舱单ID")String id) {
        return orderInformationSaveSer.forwardOrderOperate(orderStatus,id);
    }
}
